# 布尔类型
bool_1 = True
bool_2 = False
print(bool_1,type(bool_1))
# if语句
# age = int(input("请输入你的年龄： "))
# if age >= 18:
#     print("我成年了")

# if else语句
# if age >= 18:
#     print("我成年了")
# else:
#     print("我没有成年")

# if elif else 语句
# if int(input("请输入你的身高： ")) <= 120:
#     print("你的身高小于120cm，免费")
# elif int(input("请告诉我你的vip等级：")) >= 3:
#     print("你的会员等级大于3，免费")
# elif int(input("请告诉我今天几号？")) == 1:
#     print("今天是一号，免费")
# else:
#     print("不好意思，条件都不满足，需要门票10元")

# 猜数字
# num = 5
# if num == int(input("请输入第一次猜想的数字：")):
#     print("恭喜，第一次就猜中了！")
# elif int(input("猜错了，再猜一次")) == num:
#     print("right! ")
# elif int(input("again, one more time:")) == num:
#     print("finally right! ")
# else:
#     print(f"sorry ,you did not right !,the num I think is {num}")

# 判断语句的 嵌套使用
'''
    公司要发礼物：条件是：
    1. 必须是大于等于18岁小于30岁的成年人
    2. 同时入职时间需要满足大于两年，或者级别大于3才可以领取
'''
# age = int(input("请输入你的年龄："))
# if age >= 18 and age <= 30:
#     if int(input("你的入职时间是：")) > 2:
#         print("恭喜你，入职时间大于2年，这是你的礼物")
#     elif int(input("请告诉我你的员工级别：")) > 3:
#         print("恭喜你，高级员工，这是你的礼物")
#     else:
#         print("不好意思，你不符合领取条件！")
# else:
#     print("不好意思，你的年龄不符合领取条件！")

# 综合案例
# 1. 构建一个随机的数字变量
import random
num = random.randint(1,10)
guess_num = int(input("input the number you want to guess: ："))
if guess_num == num:
    print("congratulations for your first guess")
else:
    if guess_num > num:
        print("the guess is too high")
    else:
        print("the guess is too low")
    guess_num = int(input("input the number you want to guess: ："))
    if guess_num == num:
        print("congratulations for your second guess")
    else:
        if guess_num > num:
            print("the guess is too high")
        else:
            print("the guess is too low")
        guess_num = int(input("input the number you want to guess: ："))
        if guess_num == num:
            print("congratulations for your last guess")
        else:
            print("sorry, You're guessing the wrong numbers")